//
//  Person.m
//  Test001_LearnCreateClasses
//
//  Created by Ronald Ram on 9/16/12.
//  Copyright (c) 2012 Ronald Ram. All rights reserved.
//

#import "Person.h"

@implementation Person


#pragma mark INITs
- (id)init
{
    return [self initWithFName:@"Peter" LName:@"Pan"];
}

#pragma mark DESIGNATED-INITIALIZER
- (id)initWithFName:(NSString *)fn LName:(NSString *)ln
{
    if (self = [super init])
    {
        _fname = fn;
        _lname = ln;
        _age = 10;
    }
    return self;
}

-(void)dealloc
{
    [_fname release];
    [_lname release];
    [super dealloc];
}


#pragma mark PROPERTIES
@synthesize LName = _lname;
@synthesize age = _age;



#pragma mark MANUAL GETTER-SETTER
- (void)setFN:(NSString *)fn
{
    if (_fname != fn)
    {
        [_fname release];
        _fname = [fn retain];
    }
}

- (NSString *)FName { return _fname; }


#pragma mark METHODS
- (void) print
{
    NSLog(@"Name: %@ %@, Age: %i", _fname, _lname, _age);
}


@end
